Skip to main content

Chapter 40 - Terraform Debug

What to do when your Terraform goes wrong.

Overview


  • TRACE: Very detailed verbosity, shows every step taken by Terraform and produces enormous outputs with internal logs.
  • DEBUG: describes what happens internally in a more concise way compared to TRACE.
  • ERROR: shows errors that prevent Terraform from continuing.
  • WARN: logs warnings, which may indicate misconfiguration or mistakes, but are not critical to execution
  • INFO: shows general, high-level messages about the execution process.

Set the variables:

$env:TF_LOG="TRACE"
$env:TF_LOG_PATH="terraformlogfile.txt"

Permanently set


Add these variables to your PowerShell profile or your permanent exports in Linux